import React from 'react';
import { ConfigProvider } from 'antd';
import { HashRouter, Switch } from 'react-router-dom';
// import { Helmet } from 'react-helmet';
// import { Provider } from 'react-redux';
import RouterView from '@/router';
import routes from '@/router/router';
import store, { persist } from '@/store';
import theme from '@/theme.less';
import zhCN from 'antd/lib/locale/zh_CN';
import moment from 'moment';
import 'moment/locale/zh-cn'; // 解决antd日期相关组件国际化问题
import { Provider } from 'react-redux';
import { PersistGate } from 'redux-persist/integration/react';
import './App.less';

// 设置语言
moment.locale('zh-cn');

// 设置 Modal、Message、Notification rootPrefixCls。
ConfigProvider.config({
  prefixCls: theme.antPrefix,
});

function App() {
  return (
    <ConfigProvider locale={zhCN} prefixCls={theme.antPrefix}>
      <Provider store={store}>
        <PersistGate persistor={persist}>
          <HashRouter>
            <Switch>
              <RouterView routes={routes}></RouterView>
              {/* <Route exact path="*" component={404}></Route> */}
              {/* <Redirect exact from="/" to="/"></Redirect> */}
            </Switch>
          </HashRouter>
        </PersistGate>
        {/* <h3>
          <Link to="/micro-react">微前端React</Link>
        </h3>
        <h3>
          <Link to="/micro-vue">微前端Vue</Link>
        </h3>
        <div id="micro-react" />
        <div id="micro-vue" /> */}
        {/* <Task /> */}
        {/* <div id="micro-vue" /> */}
      </Provider>
    </ConfigProvider>
  );
}

export default App;
